<include file="Public/head" />
</head>
<include file="Public/common_header" />
<div class="mian">
<?php if($status==6 || $status==7): ?>
<include file="Public/sidebar"  menu="shgl.qydd" />
<?php else:?>
<include file="Public/sidebar"  menu="shgl.qy" />
<?php endif;?>
  <div class="mianR">
    <h3 class="yonghu">签约信息</h3>
    <div class="chezhu-xinxi">
      <div class="xinxi-conter xinxi-conter1" style="background: none;border: none">
        <h4 class="order_no">拍卖单号：<b>{$order.order_no}</b></h4>
      </div>
        <br/>
      <div class="xinxi-conter xinxi-conter1">
        <h4>车主信息</h4>
          <ul>
              <li class="clearfix">
                  <em>车主类型</em><em class="name-text">{$owner.owner_type_name}</em>
                  <if condition="$owner.owner_type eq 1">
                      <em>车主姓名</em><em class="name-text">{$owner.seller_name}</em>
                      <else />
                      <em>公司名称</em><em class="name-text">{$owner.seller_name}</em>
                  </if>
              </li>
              <li class="clearfix">
                  <if condition="$owner.owner_type eq 1">
                      <em>联系电话</em><em class="name-text">{$owner.phone}</em>
                      <else />
                      <em>联系人姓名</em><em class="name-text">{$owner.contact_person}</em>
                      <em>联系电话</em><em class="name-text">{$owner.phone}</em>
                  </if>
              </li>
          </ul>
        </div>
        <br/>
      <div class="xinxi-conter xinxi-conter1">
        <h4>车辆信息</h4>
          <ul>
            <li class="clearfix">
                <em>车型</em><em class="name-text1">{$car.model}</em>
                <em>排量标准</em><em class="name-text">{$car.car_cc}</em>
            </li>
            <li class="clearfix">
                <em>初登日期</em><em class="name-text1">{$car.first_reg_date}</em>
                <em>颜色</em><em class="name-text"><?php echo C("CAR_COLOR.".$car['car_color']);?></em>
            </li>
            <li class="clearfix">
                <em>表显里程</em><em class="name-text1">{$car.pointer_mileage}万公里</em>
                <em>车况级别</em><em class="name-text">{$car.composite_state}{$car.accident_level}</em>
            </li>
            <li class="clearfix">
                <em>车辆注册地</em><em class="name-text1">{$car.reg_city}</em>
                <em>竞拍结束时间</em><em class="name-text">{$order.bidding_end_time}</em>
            </li>
            <li class="clearfix">
                <em>车牌号</em><em class="name-text1"><?php echo C("PLATE_PREFIX.".$car['plate_prefix']).$car['plate_suffix']; ?></em>
                <em>车架号</em><em class="name-text">{$car.vin}</em>
            </li>
            <li class="clearfix">
                <em>过户限制</em><em class="name-text1">{$car.transfer_limit_str}</em>
                <em>渠道来源</em><em class="name-text">
                    <if condition="$car.channel_str neq ''">
                    <?php if(empty($owner['comefrom_url'])):?>
                      <?php echo $car['channel_str'];?>
                    <?php else: ?>
                      <a href="{$owner.comefrom_url}" target="_blank" rel="noreferrer"><?php echo $car['channel_str'];?></a>
                    <?php endif;?>
                    <else/>
                      未知
                    </if>
                </em>
            </li>
            <li class="clearfix"><em>所在地</em><em class="name-text">{$location_area}</em></li>
          </ul>
        </div>
        <br/>
        <if condition="$status neq 5">
            <div class="xinxi-conter xinxi-conter1">
                <h4>拍卖信息</h4>
                <ul>
                    <li class="clearfix">
                        <em>竞拍结束时间</em>
                        <em class="name-text1">{$detail.bidding_end_time}</em>
                        <em>拍卖最高价</em><em class="dian-hua">{$detail.format_best_price}元</em>
                    </li>
                    <li class="clearfix">
                        <em>保留价</em>
                        <em class="name-text1">{$detail.format_reserve_price}元</em>
                        <em>过户限制</em>
                        <em class="name-text"><?php echo C('TRANSFER_LIMIT.'.$detail['transfer_limit']);?></em>
                    </li>
                    <li class="clearfix">
                        <if condition="$detail.is_consult eq 1">
                            <em>磋商成交价格</em>
                            <em class="name-text1">{:format_money($detail['success_price'] + $detail['company_subsidies'])}元</em>
                            <em>公司补贴</em>
                            <em class="name-text">{$detail.company_subsidies}元</em>
                        <else />
                            <em>确认成交价格</em>
                            <em class="name-text1">{:format_money($detail['success_price'])}元</em>
                            <em>公司补贴</em>
                            <em class="name-text">无</em>
                        </if> 
                    </li> 
                </ul>
            </div>
            <br/>
        </if>
       <if condition="$status eq 5 || $status eq 7">
            <div class="xinxi-conter xinxi-conter1">
             <h4>签约信息</h4>
               <ul>
                 <li class="clearfix">
                     <em>交付顾问</em><em class="name-text">{$owner.deliver}</em>
                   </li>
                   <li class="clearfix">
                     <em>签约备注</em>
                     <em class="name-text">{$log.remark}</em>
                 </li>
               </ul>
             </div>
            <br/>
       <elseif condition="$status eq 2" />
            <div class="xinxi-conter xinxi-conter1">
             <h4>备注信息</h4>
               <ul>
                 <li class="clearfix">
                   <?php if($order['is_consult']== 1):?>
                     <em>磋商成功备注</em>
                   <?php else:?>
                     <em>确定成功备注</em>
                   <?php endif;?>
                     <em class="name-text">{$remark.remark}</em>
                   </li>
                   <li class="clearfix">
                     <em>签约调度备注</em>
                     <em class="name-text">{$owner.sign_reserve_remark}</em>
                 </li>
               </ul>
             </div>
            <br/>
       </if>
      <if condition="$order['status'] egt 8">
          <if condition="$status neq 5 && $status neq 7">
            <div class="xinxi-conter xinxi-conter1">
                <h4>签约信息</h4>
                <ul>
                    <li class="clearfix">
                        <em>交付顾问</em><em class="name-text1">{$owner.deliver}</em>
                        <em>签约时间</em><em class="name-text">{$owner.sign_date}</em>
                    </li>
                    <li class="clearfix">
                        <em>年检情况</em><em class="name-text1"><?php echo C('MOT.'.$car['mot']) ?></em>
                        <em>违章情况</em><em class="name-text"><?php echo C('PECCANCY.'.$car['peccancy']) ?></em>
                    </li>
                    <li class="clearfix">
                        <em>三证合一</em><em class="name-text1"><?php
                            if($car['car_source']=='2'){
                                echo C('THREE_IN_ONE.'.$car['three_in_one']);
                            }else{
                                echo '--';
                            }
                            ?>
                        </em>
                        <?php if($owner['sign_service_method']==3):?>
                        <em>预约门店</em><em class="name-text">{$terminal}</em>
                        <?php else:?>
                        <em>预约地址</em><em class="name-text">{$owner.address}</em>
                        <?php endif;?>
                    </li>
                    <li class="clearfix">
                        <em>签约备注</em><em class="name-text" style="width:875px;">{$log.remark}</em>
                    </li>
                     <li class="clearfix">
                        <?php if($order['is_consult']== 1):?>
                          <em>磋商成功备注</em>
                        <?php else:?>
                          <em>确定成功备注</em>
                        <?php endif;?>
                          <em class="name-text">{$remark.remark}</em>
                    </li>
                </ul>
            </div>
           </if>
      </if>
        <?php if(!empty($trace_log)):?>
        <br/>
        <h3 class="yonghu">签约跟踪日志</h3>
        <div class="yonghuText">
            <?php $action_type = array(1=>"签约成功",2=>"继续跟踪",3=>"签约失败");?>
            <ul>
                <volist name="trace_log" id="log" key="k">
                    <li class="{$k%2==0?'xitongBg':''} clearfix">
                        <em class="huShi">{$log.createtime}</em>
                        <em>交付顾问</em>
                        <em>{$log.deliver}</em>
                        <em><?php echo $action_type[$log['result']];?></em>
                        <em class="huShi">{$log.remark}</em>
                    </li>
                </volist>
            </ul>
        </div>
        <?php endif;?>
    </div>

    <?php if($order['status']==7):?>
    <h3 class="yonghu">请选择确认结果</h3>
    <div class="yuyue">
      <ul>
          <li class="yuCurrent">签约成功</li>
          <li class="">继续跟踪</li>                    
          <li class="">签约失败</li>                    
      </ul>
    </div>
      <div class="listBox">
        <div class="yuList">
          <div class="xuanzhe">
            <ul> 
              <form id="successForm" method="post" action="">
                <input type="hidden" name="order_id" value="{$order.order_id}" />
                <input type="hidden" name="car_id" value="{$car.car_id}" />
                <input type="hidden" name="owner_id" value="{$owner.owner_id}" />
                <li class="gouhu clearfix transfer_proc" style="height:24px;">
                  <span style="width:80px;margin-left:-18px">*过户手续</span>
                  <label>
                  <?php foreach($trans_procs as $key=>$vo):?>
                    <em>{$vo}<input type="checkbox"  value="{$vo}" checked="" /></em>
                    <?php endforeach;?>
                  </label>
                  <input id="transfer_proc" type="hidden" name="transfer_proc"  value=""/>
                </li>

                  <li class="kaihu clearfix mot">
                      <span>*年检情况</span>
                      <div class="yearly"><em>有效期内</em><em>已过有效期</em></div>
                      <input id="MOT" name="MOT" type="hidden" value="" />
                  </li>
                  <li class="kaihu clearfix peccancy">
                      <span>*违章情况</span>
                      <div class="yearly"><em>无</em><em>有</em></div>
                      <input id="peccancy" name="peccancy" type="hidden" value="" />
                  </li>
                  <!--<li class="kaihu clearfix car_source">-->
                      <!--<span>*车辆来源</span>-->
                      <!--<div class="yearly"><em>4S店</em><em>个人</em></div>-->
                      <!--<input id="car_source" name="car_source" type="hidden" value="" />-->
                  <!--</li>-->
                  <li class="kaihu clearfix three_in_one">
                      <span>*三证合一</span>
                      <div class="yearly"><em>是</em><em>否</em></div>
                      <input id="three_in_one" name="three_in_one" type="hidden" value="" />
                  </li>

                <li class="kaihu clearfix">
                  <span>*收款人姓名</span>
                  <input name="payee_name" type="text" value="" placeholder="请输入收款人姓名">
                  <span>*开户行</span>
                  <input name="deposit_bank"  type="text" value="" placeholder="请输入收款人账号开户行">
                </li>
                <li class="kaihu clearfix">
                  <span>*收款人账号</span>
                  <input name=payee_account type="text" value="" placeholder="请输入收款人账号">
                  <span>*签约时间</span>
                  <input name="sign_time" type="text" id="demoText4"  class="xiaci"  readonly="" placeholder="请选择签约时间">
               </li>
                <li class="clearfix remarks1">
                  <span>备注</span>
                  <textarea name="succes_remark"></textarea>
                </li>
              </form>  
            </ul>
          </div>
          <div class="yongBtn1">
              <input id="sub_success" type="button" value="确定" class="queding" />
          </div>
        </div>
        <div class="yuList" style="display:none;">
          <div class="xuanzhe1">
            <ul>
              <form id="traceForm">
                <input type="hidden" name="order_id" value="{$order.order_id}" />
                <input type="hidden" name="car_id" value="{$car.car_id}" />
                <input type="hidden" name="owner_id" value="{$owner.owner_id}" />
                <li class="genBtn1 clearfix">
                  <span class="gencuur">电话无人接听<input  value="电话无人接听" type="checkbox" /></span>
                  <span class="gencuur">电话停机或关机<input  value="电话停机或关机" type="checkbox" /></span>
                  <span class="gencuur">最近没时间<input  value="最近没时间" type="checkbox" /></span>
                  <span class="gencuur">直接挂断电话<input  value="直接挂断电话" type="checkbox" /></span>
                  <span class="gencuur">需要了解二手车拍卖<input value="需要了解二手车拍卖" type="checkbox" /></span>
                </li>
                <li class="reason clearfix">
                  <span>其他原因</span>
                  <textarea class="remark" ></textarea>
                </li>
                <input id="trace_remark" type="hidden"  name="trace_remark" value=""/>
                <li class="clearfix">
                  <span>下次跟踪时间</span>
                  <input name="next_trace_time" type="text" value="请选择下次跟踪时间" id="demoText10" class="xiaci" readonly />
                </li>              
              </form>
            </ul>
          </div>
          <div class="yongBtn">
            <input id="sub_trace" type="button" value="确定" class="queding" />
            <input name="重置" type="reset" class="quxiao" value="取消" />
          </div>
          </div>
          <div class="yuList" style="display:none;">
            <div class="xuanzhe1">
              <ul>
                <form id ="faildForm">
                  <input type="hidden" name="order_id" value="{$order.order_id}" />
                  <input type="hidden" name="car_id" value="{$car.car_id}" />
                  <input type="hidden" name="owner_id" value="{$owner.owner_id}" />
                  <li class="reason clearfix">
                    <span>备注</span>
                    <textarea id="" name="faild_remark"></textarea>
                 </li>
                </form>
              </ul>
            </div>
            <div class="yongBtn1">
              <input id="sub_faild" type="button" value="确定" class="queding" />
            </div>
          </div>
        </div>
    </div>
    <?php else:?>
    <div class="yongBtn1">
        <input class="quxiao" type="submit" value="关闭" onclick="window.close();">
    </div>
    <?php endif;?>
  </div>
<script>
$(document).ready(function() {
    $(".xuanzhe ul li .yearly em").click(function(){
        $(this).siblings().css({"color":"#303030","background":"#ccc","border":"solid 1px #bababa"});
        $(this).siblings().removeClass('genzongHover');
        $(this).css({"color":"#fff","background":"#20ab4f","border":"solid 1px #20ab4f"});
        $(this).addClass('genzongHover');

        if($(this).html()=="个人"){
            $(".xuanzhe ul .three").css("display","block");
        }else if($(this).html()=="4S店"){
            $(".xuanzhe ul .three").css("display","none");
        }
        if($(".xuanzhe ul .three .yearly em").html()=="是"){
            $(this).parent().parent().css("display","block");
        }
    })

});
</script>

<script>
$(".genBtn1 input").click(function(){
    if($(this).parent().hasClass("gencuur")){
        $("#trace_remark").val($(this).val());
    }else{
        $("#trace_remark").val('');
    }
})

$(".remark").blur(function(){
    var remark = $(this).val();
    if(remark!=''){
        $("#trace_remark").val(remark);
    }
});

$("#sub_faild").click(function(){
    $.post("/Sign/signFaild",$("#faildForm").serialize(),function(data){
        if(data.code!==200){
            shibai_alert(data.msg,2000);
            return false;
        }
        btn_alert("确认成功",1500,function(){
            window.location.href=document.referrer
        });        
    },"json");    
});

$("#sub_trace").click(function(){
    $.post("/Sign/signTrace",$("#traceForm").serialize(),function(data){
        if(data.code!==200){
            shibai_alert(data.msg,2000);
            return false;
        }
        btn_alert("确认成功",1500,function(){
            window.location.href=document.referrer
        });        
    },"json");    
});

$("#sub_success").click(function(){
    //过户手续
    var transfer_proc = new Array();
    $(".transfer_proc .genzongHover").each(function(){
        transfer_proc.push($(this).children("input").val()) 
    });
    $("#transfer_proc").val(transfer_proc);

    //年检情况
    var mot = new Array();
       $(".mot .genzongHover").each(function(){
           mot.push($(this).html())
       });
       $("#MOT").val(mot);

    //违章情况
    var peccancy = new Array();
       $(".peccancy .genzongHover").each(function(){
        peccancy.push($(this).html())
       });
       $("#peccancy").val(peccancy);

    //车辆来源
    var car_source = new Array();
       $(".car_source .genzongHover").each(function(){
        car_source.push($(this).html())
       });
       $("#car_source").val(car_source);

    //三证合一
    var three_in_one = new Array();
       $(".three_in_one .genzongHover").each(function(){
        three_in_one.push($(this).html())
       });
       $("#three_in_one").val(three_in_one);

    $(".yunBei").css("display","block").unbind('click')
    $(".loading").fadeIn();
    $.post("/Sign/signSuccess",$("#successForm").serialize(),function(data){
        if(data.code!==200){
            shibai_alert(data.msg,1000,function () {
                $(".loading").fadeOut();
                $(".yunBei").css('display','none')
            });
            return false;
        }
        btn_alert("确认成功",1500,function(){
            window.location.href=document.referrer
        });        
    },"json");    
});

</script>
</body>
</html>